-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: Add documentation for metrics.collections API #2407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add new primary example using ragas.metrics.collections - Show modern API with llm_factory and direct parameter passing - Move legacy SingleTurnSample examples to Legacy section - Relocate HHEM section to Legacy (no collections version yet) - Add note about sync .score() method availability
- Legacy API will be deprecated in v0.4 - Complete removal planned for v1.0 - Added warning box to guide users to migrate
- Add new primary example using ragas.metrics.collections - Show modern API with llm_factory and direct parameter passing - Move legacy SingleTurnSample examples to Legacy section - Add deprecation timeline (v0.4 deprecated, v1.0 removed) - New example tested and verified to work correctly
Updated BleuScore section in traditional.md to: - Show new collections-based API as primary example - Add synchronous usage note - Include configuration example for kwargs parameter - Move legacy SingleTurnSample example to dedicated Legacy API section - Add deprecation warning for legacy API The new example was tested and produces the expected output.
…s API - Add new primary example using collections-based API with llm_factory - Include synchronous usage note for .score() method - Move legacy SingleTurnSample example to Legacy Metrics API section - Add deprecation timeline warning (v0.4 deprecated, v1.0 removed) - Preserve conceptual explanation and "How It's Calculated" section - Tested new example and verified it produces expected output
- Migrate primary example to use AnswerSimilarity from ragas.metrics.collections - Use modern OpenAIEmbeddings instead of deprecated embedding_factory - Add synchronous usage note for .score() method - Move legacy SingleTurnSample example to "Legacy Metrics API" section - Add deprecation timeline warning (v0.4 deprecation, v1.0 removal) - Update terminology from "answer" to "response" for consistency - Add step 4 to calculation explanation showing final score output - Tested example successfully with no deprecation warnings
Updated answer_relevance.md to follow the new pattern: - Added collections-based API example as primary example - Improved structure with clearer title and description - Added synchronous usage note - Moved legacy SingleTurnSample example to "Legacy Metrics API" section - Tested new example successfully
- Add examples for ContextPrecision and ContextUtilization using collections API - Simplify documentation to show only user-facing metrics (removed wrapper details) - Move legacy examples to deprecated section - All examples tested and verified
- Add new collections-based API example at the top - Add synchronous usage note - Move legacy API examples to deprecated section - Tested example and verified it works correctly
- Add new collections-based API example at the top - Add synchronous usage note - Preserve configuration section (rouge_type and mode) - Move legacy API examples to Legacy Metrics API section with deprecation warning - Tested example code and verified it produces expected output
- Updated example to use SemanticSimilarity from collections API - Changed title from 'Answer Similarity' to 'Semantic Similarity' for consistency - Added synchronous usage note - Preserved 'How It's Calculated' section - Moved legacy API examples to bottom with deprecation warning - Tested example and verified it produces expected output
- Add new collections-based API example using SummaryScore from ragas.metrics.collections - Include synchronous usage note with .score() method - Add custom configuration example for length_penalty and coeff parameters - Move legacy example to Legacy Metrics API section with deprecation warning - Preserve all conceptual explanations and formulas - Tested example code and verified it produces expected output
- Add primary example using collections-based API from ragas.metrics.collections - Include examples for both 'relevant' and 'irrelevant' modes with outputs - Add synchronous usage note - Move legacy examples to Legacy Metrics API section with deprecation warning - Preserve 'How It's Calculated' section and credits - Tested example code and verified it works correctly
- Add collections-based API example with LLM and embeddings setup - Move legacy evaluate() example to Legacy Metrics API section - Add deprecation warning for legacy API - Include synchronous usage note - Tested example code and verified it works correctly Note: Embeddings are required because default weights [0.75, 0.25] include semantic similarity. See issue #2408 for making embeddings optional when weights[1] == 0.
…Similarity) to collections API - Updated NonLLMStringSimilarity with collections API example and configuration section - Updated ExactMatch with collections API example - Updated StringPresence with collections API example - Added synchronous usage notes for all three metrics - Moved legacy examples to Legacy Metrics API section with deprecation warnings - All examples tested and verified to work correctly
Reorder imports to follow Python conventions (alphabetical order, grouped by standard library, third-party, and local imports) and fix minor typo in Opik integration documentation.
anistark
approved these changes
Nov 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates the documentation for metrics to showcase the new
ragas.metrics.collectionsAPI as the primary recommended approach, while preserving legacy API documentation for backward compatibility.Changes
Metrics
Documentation Pattern
Each metric documentation follows this structure:
Test Plan